package cn.kgc.springboot03.controller;

import cn.kgc.springboot03.entity.Student;
import cn.kgc.springboot03.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author: mosin
 * @version: v1.0  2022/5/19
 */
@Controller
@RequestMapping("student")
public class StudentController {
    @Autowired
    private StudentService studentService;

    @ResponseBody
    @RequestMapping("/findOne")
    public Object selectById(Integer id){
        Student student = studentService.selectById(id);
        return student;
    }

    @ResponseBody
    @RequestMapping("/all")
    public Object selectAll(){
        return studentService.selectAll();
    }
}
